import { ApiVersoin } from '@/common/enums/httpEnum'

const Url = {
  phoneLogin: '/user-verify/login',
  wxPhoneLogin: '/user-verify/authorized-login',
  getUserInfos: '/customer-info/one',
  logout: `${ApiVersoin.v3}/qy-user/logout`,
  customerCenter: `${ApiVersoin.V10}/customer-center/my-sxj`,
  identity_ocr: `/applet/best-sign-h5/identity-ocr`,
  confirmAuthInfo: `/customer-info/confirm-auth-info`,
  updateSignInfo: `/customer-info/update-sign-info`,
  customerUpdate: `/customer/update`,
}

// 更新租户信息
export const customerUpdate = (data) => uni.$uv.http.post(Url.customerUpdate, data, { custom: { showLoading: true, showMessage: true } })

/**
 * @description: user phoneLogin api
 */
export const loginByPhone = (params) => uni.$uv.http.post(Url.phoneLogin, params, { custom: { showMessage: true } })

/**
 * @description: user wxPhoneLogin api
 */
export const loginByWxPhone = (params) => uni.$uv.http.post(Url.wxPhoneLogin, params)

/**
 * @description: getUserInfo
 */
export const getUserInfo = (params) => uni.$uv.http.get(Url.getUserInfos, { params, custom: {} })

/**
 * @description: logout
 */
export const doLogout = (params) => uni.$uv.http.get(Url.logout, { params })

/**
 * @description: logout
 */
export const customerCenter = (params) => uni.$uv.http.get(Url.customerCenter, { params })
/**
 * @description: ocr身份证识别
 */
export const identity_ocr = (data) => uni.$uv.http.post(Url.identity_ocr, data, { custom: { showLoading: true, showMessage: false } })

/**
 * @description: ocr身份证识别后提交信息
 */
export const confirmAuthInfo = (data) => uni.$uv.http.post(Url.confirmAuthInfo, data, { custom: { showLoading: true } })

/**
 * @description: 提交邮箱等信息接口
 */
export const updateSignInfo = (data) => uni.$uv.http.post(Url.updateSignInfo, data, { custom: { showLoading: true } })
